Skip to content

remove examples for ENV key value without '=' - #11414

Merged
usha-mandya merged 1 commit into
docker:masterfrom
thaJeztah:bare_env_examples
Sep 23, 2020
Merged

remove examples for ENV key value without '='#11414
usha-mandya merged 1 commit into
docker:masterfrom
thaJeztah:bare_env_examples

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

The ENV key value form can be ambiguous, for example, the following defines a single env-variable (ONE) with value "TWO= THREE=world":

ENV ONE TWO= THREE=world

While we cannot deprecate/remove that syntax (as it would break existing Dockerfiles), we should reduce exposure of the format in our examples.

Also updating some code-blocks that were missing language-hints

Related issues (optional)

relates to moby/buildkit#1692 (comment), docker/cli#2741

@thaJeztah

Copy link
Copy Markdown
Member Author

Need to verify if the code-hint changes/indentation is right, so waiting for Netlify preview

@netlify

netlify Bot commented Sep 23, 2020

Copy link
Copy Markdown

Deploy preview for docsdocker ready!

Built with commit f6adc80

https://deploy-preview-11414--docsdocker.netlify.app

Comment thread compose/django.md Outdated
```none
version: '3'
```yaml
version: "{{ site.compose_file_v3 }}"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. this somehow adds a space in front of each line. I recall we had a similar issue at some point; #8105 (also somewhere else, but trying to find what the solution was for that)

@thaJeztah
thaJeztah force-pushed the bare_env_examples branch 5 times, most recently from 7b8b8ba to 8ad9c52 Compare September 23, 2020 12:40
The `ENV key value` form can be ambiguous, for example, the following defines
a single env-variable (`ONE`) with value `"TWO= THREE=world"`:

    ENV ONE TWO= THREE=world

While we cannot deprecate/remove that syntax (as it would break existing
Dockerfiles), we should reduce exposure of the format in our examples.

Also updating some code-blocks that were missing language-hints

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah

Copy link
Copy Markdown
Member Author

ok, fixed the indentation, this should be ready for review.

To view without the indentation changes, use this link: https://github.com/docker/docker.github.io/pull/11414/files?w=1

@usha-mandya ptal

@StefanScherer StefanScherer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

LGTM

@StefanScherer

Copy link
Copy Markdown
Member

Thanks @thaJeztah Good to know that.
Today I tried the VSCode Docker extension to create a Dockerfile for Node.js and it uses the old format, also their docs show some old examples. https://code.visualstudio.com/docs/containers/quickstart-node#_add-an-environment-variable-to-the-image

I try to create PR's in the extension and their docs to move to ENV key=var

@thaJeztah

Copy link
Copy Markdown
Member Author

Good catch, thanks @StefanScherer !

@usha-mandya

Copy link
Copy Markdown
Member

Thank you @StefanScherer @thaJeztah

@usha-mandya
usha-mandya merged commit 7efcb01 into docker:master Sep 23, 2020
@thaJeztah
thaJeztah deleted the bare_env_examples branch September 23, 2020 14:21
@StefanScherer

Copy link
Copy Markdown
Member

I also created microsoft/vscode-docs#4024 in the vscode docs repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants